Skip to content

Conversation

harp-intel
Copy link
Contributor

@harp-intel harp-intel commented Aug 25, 2025

This pull request introduces significant enhancements to the metrics loading and processing pipeline, primarily by adding support for threshold expressions and improving metric definition handling. The changes affect how metrics are parsed, transformed, and evaluated, with new fields and logic for threshold expressions, more robust filtering, and improved naming consistency.

Metric Definition and Threshold Support

  • Extended the MetricDefinition struct to include fields for LegacyName, Category, Level, ThresholdExpression, ThresholdVariables, and ThresholdEvaluable, enabling richer metric metadata and threshold evaluation. [1] [2]
  • Added logic to extract, transform, and initialize threshold expressions and their variables, ensuring threshold expressions are parsed and evaluable like main metric expressions. [1] [2] [3] [4]

Perfmon Loader Improvements

  • Refactored metric filtering to use MetricName instead of LegacyName for more consistent identification, and improved error handling when metrics are missing. Added helper functions for finding metrics by both names. [1] [2] [3]
  • Added support for loading and transforming threshold expressions from perfmon metric definitions, including alias replacement and format conversion.

Code Consistency and Usability

  • Updated metric printing and summary functions to accept and use the enhanced metric definitions, ensuring all output and summaries reflect the new fields and threshold support. [1] [2] [3] [4]
  • Standardized metric naming in output, using LegacyName without the metric_ prefix for improved readability.

Miscellaneous

  • Improved transformation logic for metric and threshold expressions, handling conditional formats and logical operators more robustly.
  • Added utility imports and code organization for new functionality.

These changes collectively make the metrics system more extensible and robust, especially in handling thresholds and ensuring consistent metric identification across loaders and output.

… deprecated. All metric descriptions in HTML report.

Signed-off-by: Harper, Jason M <[email protected]>
@harp-intel harp-intel requested a review from Copilot August 25, 2025 22:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes metric naming to match perfmon standards by removing legacy names as the primary metric identifiers. Legacy names are now optional and deprecated, supporting backward compatibility through a new --legacy-names flag. Additionally, metric descriptions are now included in HTML reports for enhanced usability.

  • Updated metric naming system to use modern perfmon names by default
  • Introduced optional --legacy-names flag for backward compatibility
  • Enhanced HTML reports with metric descriptions for better user experience

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/metrics/summary.go Added metricDefinitions parameter to summary functions and updated template variable naming
cmd/metrics/resources/perfmon/srf/srf.json Removed LegacyName fields from metric definitions
cmd/metrics/resources/perfmon/spr/spr.json Removed LegacyName fields from metric definitions
cmd/metrics/resources/perfmon/icx/icx.json Removed LegacyName fields from metric definitions
cmd/metrics/resources/perfmon/gnr/gnr.json Removed LegacyName fields from metric definitions
cmd/metrics/resources/perfmon/emr/emr.json Removed LegacyName fields from metric definitions
cmd/metrics/resources/base.html Replaced hardcoded metric descriptions with dynamic template variable
cmd/metrics/print.go Added metric name translation functions and updated output format functions
cmd/metrics/metrics.go Added legacy names flag and updated function calls
cmd/metrics/loader_perfmon.go Updated metric lookups to use MetricName instead of LegacyName
cmd/metrics/loader.go Extended MetricDefinition struct with additional fields

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@harp-intel harp-intel changed the title Metric names modernized to match perfmon. "Legacy" names optional and… perfmon Metric names and descriptions Aug 25, 2025
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
@harp-intel harp-intel changed the title perfmon Metric names and descriptions perfmon Metric names, descriptions, and thresholds Aug 27, 2025
@harp-intel harp-intel changed the title perfmon Metric names, descriptions, and thresholds perfmon Metric names, descriptions, and tips Aug 28, 2025
@harp-intel harp-intel merged commit 9d65c0f into main Aug 30, 2025
5 checks passed
@harp-intel harp-intel deleted the metricname branch August 30, 2025 03:02
harp-intel added a commit that referenced this pull request Sep 1, 2025
* add Gaudi microarchitecture to report

Signed-off-by: Harper, Jason M <[email protected]>

* perfmon Metric names, descriptions, and tips (#472)

* Metric names modernized to match perfmon. "Legacy" names optional and deprecated. All metric descriptions in HTML report.

Signed-off-by: Harper, Jason M <[email protected]>

* temporary threshold value

Signed-off-by: Harper, Jason M <[email protected]>

* tma metric thresholds

Signed-off-by: Harper, Jason M <[email protected]>

* style the tooltips

Signed-off-by: Harper, Jason M <[email protected]>

* indent on TMA child metrics

Signed-off-by: Harper, Jason M <[email protected]>

* add tuning tips

Signed-off-by: Harper, Jason M <[email protected]>

* skip threshold if no metric variables defined

Signed-off-by: Harper, Jason M <[email protected]>

* revert to legacy names

Signed-off-by: Harper, Jason M <[email protected]>

* set legacy name to name for legacy metric defs

Signed-off-by: Harper, Jason M <[email protected]>

* fix kernel_CPI metric formula and add threshold to kernel utilization

Signed-off-by: Harper, Jason M <[email protected]>

---------

Signed-off-by: Harper, Jason M <[email protected]>

* add Gaudi microarchitecture to report

Signed-off-by: Harper, Jason M <[email protected]>

---------

Signed-off-by: Harper, Jason M <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include a description for every metric listed in the summary HTML, all metrics tab. add metrics insights
1 participant